﻿using IMT.Controllers;
using IMT.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using UApiService;

namespace IMT.Areas.Report.Controllers
{
    public class ExcelController : BaseController
    {
        //
        // GET: /Report/Excel/

        public ActionResult Dept(int? year, int? month)
        {
            string RoleCode = "l.lydia@cjatech.com|y.corey@cjatech.com";
            UserInfo user = (UserInfo)Session[UserInfo.SESSION_KEY];
            if (RoleCode.IndexOf(user.UserName.ToLower()) > -1)
            {
                CommonApiPackage result = new BizCenter().ApiGet("ITGetStaffDailyDatail", new { Year = year == null ? 0 : year.Value, Month = month == null ? 0 : month.Value });
                return new NPOIHelp().ExportExcel(result.ApiParamObj, "日报报表");
            }
            else
            {
                return Content("你没有权限访问该连接！");
            }
        }

    }
}
